package com.dp.vo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.struts2.json.annotations.JSON;

@Entity
@Table(name = "t_occupancy")
public class TOccupancy implements Serializable {
	    private static final long serialVersionUID = 1L;
	    @Id
	    @GeneratedValue(strategy = GenerationType.IDENTITY)
	    @Basic(optional = false)
	    @Column(name = "id")
	    private Integer id;
	    @JoinColumn(name = "cid", referencedColumnName = "id")
	    @ManyToOne
	    private TCertificate certificate;
	    @Column(name = "spcode")
	    private String spcode;
	    @Column(name = "sn")
	    private String sn;
	    @Column(name = "roomnumber")
	    private String roomnumber;
	    @Column(name = "checkin_time")
	    private Date checkin_time;
	    @Column(name = "plancheckin_time")
	    private Date plancheckin_time;
	    @Column(name = "actualcheckin_time")
	    private Date actualcheckin_time;
	    @Column(name = "checkout")
	    private Integer checkout;
	    
	    public TOccupancy(){
	    	
	    }
	   
		public Integer getId() {
			return id;
		}

		public void setId(Integer id) {
			this.id = id;
		}

		public TCertificate getCertificate() {
			return certificate;
		}

		public void setCertificate(TCertificate certificate) {
			this.certificate = certificate;
		}

		public String getSpcode() {
			return spcode;
		}

		public void setSpcode(String spcode) {
			this.spcode = spcode;
		}

		public String getSn() {
			return sn;
		}

		public void setSn(String sn) {
			this.sn = sn;
		}

		public String getRoomnumber() {
			return roomnumber;
		}

		public void setRoomnumber(String roomnumber) {
			this.roomnumber = roomnumber;
		}
		
		@JSON(format="yyyy-MM-dd HH:mm:ss")
		public Date getCheckin_time() {
			return checkin_time;
		}

		public void setCheckin_time(Date checkin_time) {
			this.checkin_time = checkin_time;
		}

		@JSON(format="yyyy-MM-dd HH:mm:ss")
		public Date getPlancheckin_time() {
			return plancheckin_time;
		}

		public void setPlancheckin_time(Date plancheckin_time) {
			this.plancheckin_time = plancheckin_time;
		}

		@JSON(format="yyyy-MM-dd HH:mm:ss")
		public Date getActualcheckin_time() {
			return actualcheckin_time;
		}

		public void setActualcheckin_time(Date actualcheckin_time) {
			this.actualcheckin_time = actualcheckin_time;
		}

		public Integer getCheckout() {
			return checkout;
		}

		public void setCheckout(Integer checkout) {
			this.checkout = checkout;
		}

		@Override
	    public int hashCode() {
	        int hash = 0;
	        hash += (id != null ? id.hashCode() : 0);
	        return hash;
	    }

	    @Override
	    public boolean equals(Object object) {
	        if (!(object instanceof TOccupancy)) {
	            return false;
	        }
	        TOccupancy other = (TOccupancy) object;
	        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
	            return false;
	        }
	        return true;
	    }

	    @Override
	    public String toString() {
	        return "com.dp.vo.TOccupancy[id=" + id + "]";
	    }

}
